]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
lint: Enable 'prefer-const' rule
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 24 Oct 2025 11:39:03 +0000 (13:39 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Fri, 24 Oct 2025 13:37:58 +0000 (15:37 +0200)
Now that all code conforms with the rule, we can enforce it to make
sure we stick to it with new code.

Relax the rule for destructuring, so we don't have to jump through
hoops to avoid "mixed" assignments.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3931>

tools/eslint.config.js

index 6c7c3774293a3236c5706aeb577a56d8b6ab3726..8c59c581ec750dc9f9e6ab44c85cabb2a6415b14 100644 (file)
@@ -32,6 +32,9 @@ export default defineConfig([
                 afterColon: true,
             }],
             'prefer-arrow-callback': 'error',
+            'prefer-const': ['error', {
+                destructuring: 'all',
+            }],
             'jsdoc/require-param-description': 'off',
             'jsdoc/require-jsdoc': ['error', {
                 exemptEmptyFunctions: true,